package demo6;

import java.util.Objects;

public class Student {
    private String name;
    private int age;
    private int  ID;

    public Student(String name, int age, int ID) {
        this.name = name;
        this.age = age;
        this.ID = ID;
    }

    @Override
    public boolean equals(Object o) {
        if(o == null) {
            return false;
        }
        if (this == o) {
            return true;
        }
        if(!(o instanceof Student)) {
            return false;
        }
        Student student = (Student) o;
        return student.name.equals(this.name)
                && student.age == this.age
                && student.ID == this.ID;
    }

}
